home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / idl / nsISelectionController.idl < prev    next >
Text File  |  2006-05-08  |  10KB  |  243 lines

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  2.  *
  3.  * ***** BEGIN LICENSE BLOCK *****
  4.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  5.  *
  6.  * The contents of this file are subject to the Mozilla Public License Version
  7.  * 1.1 (the "License"); you may not use this file except in compliance with
  8.  * the License. You may obtain a copy of the License at
  9.  * http://www.mozilla.org/MPL/
  10.  *
  11.  * Software distributed under the License is distributed on an "AS IS" basis,
  12.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  13.  * for the specific language governing rights and limitations under the
  14.  * License.
  15.  *
  16.  * The Original Code is mozilla.org code.
  17.  *
  18.  * The Initial Developer of the Original Code is
  19.  * Netscape Communications Corporation.
  20.  * Portions created by the Initial Developer are Copyright (C) 1998
  21.  * the Initial Developer. All Rights Reserved.
  22.  *
  23.  * Contributor(s):
  24.  *   Sammy Ford
  25.  *
  26.  * Alternatively, the contents of this file may be used under the terms of
  27.  * either of the GNU General Public License Version 2 or later (the "GPL"),
  28.  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  29.  * in which case the provisions of the GPL or the LGPL are applicable instead
  30.  * of those above. If you wish to allow use of your version of this file only
  31.  * under the terms of either the GPL or the LGPL, and not to allow others to
  32.  * use your version of this file under the terms of the MPL, indicate your
  33.  * decision by deleting the provisions above and replace them with the notice
  34.  * and other provisions required by the GPL or the LGPL. If you do not delete
  35.  * the provisions above, a recipient may use your version of this file under
  36.  * the terms of any one of the MPL, the GPL or the LGPL.
  37.  *
  38.  * ***** END LICENSE BLOCK ***** */
  39.  
  40.  
  41. #include "nsISupports.idl"
  42. #include "nsISelection.idl"
  43. #include "nsISelectionDisplay.idl"
  44.  
  45. %{C++
  46. typedef short SelectionType;
  47. typedef short SelectionRegion;
  48. %}
  49.  
  50. interface nsIDOMNode;
  51. interface nsISelection;
  52. interface nsISelectionDisplay;
  53.  
  54. [scriptable, uuid(93AAA4A9-B78E-42eb-9D67-5DE77EE2F54B)]
  55. interface nsISelectionController : nsISelectionDisplay
  56. {
  57.    const short SELECTION_NONE=0;
  58.    const short SELECTION_NORMAL=1;
  59.    const short SELECTION_SPELLCHECK=2;
  60.    const short SELECTION_IME_RAWINPUT=4;
  61.    const short SELECTION_IME_SELECTEDRAWTEXT=8;
  62.    const short SELECTION_IME_CONVERTEDTEXT=16;
  63.    const short SELECTION_IME_SELECTEDCONVERTEDTEXT=32;
  64.    const short SELECTION_ACCESSIBILITY=64; // For accessibility API usage
  65.    const short NUM_SELECTIONTYPES=8;
  66.  
  67.    const short SELECTION_ANCHOR_REGION = 0;
  68.    const short SELECTION_FOCUS_REGION = 1;
  69.    const short NUM_SELECTION_REGIONS = 2;
  70.  
  71.    const short SELECTION_OFF = 0;
  72.    const short SELECTION_HIDDEN =1;//>HIDDEN displays selection
  73.    const short SELECTION_ON = 2;
  74.    const short SELECTION_DISABLED = 3;
  75.    const short SELECTION_ATTENTION = 4;
  76.  
  77.    /**
  78.    * SetDisplaySelection will set the display mode for the selection. OFF,ON,DISABLED
  79.    */
  80.     void    setDisplaySelection(in short toggle);
  81.  
  82.    /**
  83.    * GetDisplaySelection will get the display mode for the selection. OFF,ON,DISABLED
  84.    */
  85.     short   getDisplaySelection();
  86.  
  87.    /**
  88.    * GetSelection will return the selection that the presentation
  89.    *  shell may implement.
  90.    *
  91.    * @param aType will hold the type of selection //SelectionType
  92.    * @param _return will hold the return value
  93.    */
  94.     nsISelection getSelection(in short type);
  95.  
  96.    /**
  97.    * ScrollSelectionIntoView scrolls a region of the selection,
  98.    * so that it is visible in the scrolled view.
  99.    *
  100.    * @param aType the selection to scroll into view. //SelectionType
  101.    * @param aRegion the region inside the selection to scroll into view. //SelectionRegion
  102.    * @param aIsSynchronous when true, scrolls the selection into view
  103.    * before returning. If false, posts a request which is processed
  104.    * at some point after the method returns.
  105.    */
  106.     void scrollSelectionIntoView(in short type, in short region, in boolean isSynchronous);
  107.    /**
  108.    * RepaintSelection repaints the selection specified by aType.
  109.    *
  110.    * @param aType specifies the selection to repaint.
  111.    */
  112.     void repaintSelection(in short type);
  113.  
  114.    /**
  115.    * Set the caret as enabled or disabled. An enabled caret will
  116.    * draw or blink when made visible. A disabled caret will never show up.
  117.    * Can be called any time.
  118.    * @param aEnable PR_TRUE to enable caret.  PR_FALSE to disable.
  119.    * @return always NS_OK
  120.    */
  121.  
  122.     void setCaretEnabled(in boolean enabled);
  123.  
  124.    /**
  125.    * Set the caret readonly or not. An readonly caret will
  126.    * draw but not blink when made visible. 
  127.    * @param aReadOnly PR_TRUE to enable caret.  PR_FALSE to disable.
  128.    * @return always NS_OK
  129.    */
  130.     void setCaretReadOnly(in boolean readOnly);
  131.  
  132.    /**
  133.    * Gets the current state of the caret.
  134.    * @param aEnabled  [OUT] set to the current caret state, as set by SetCaretEnabled
  135.    * @return   if aOutEnabled==null, returns NS_ERROR_INVALID_ARG
  136.    *           else NS_OK
  137.    */
  138.     boolean getCaretEnabled();
  139.  
  140.    /**
  141.    * Show the caret even in selections. By default the caret is hidden unless the
  142.    * selection is collapsed. Use this function to show the caret even in selections.
  143.    * @param aVisibility PR_TRUE to show the caret in selections.  PR_FALSE to hide.
  144.    * @return always NS_OK
  145.    */
  146.     void setCaretVisibilityDuringSelection(in boolean visibility);
  147.  
  148.    /** CharacterMove will move the selection one character forward/backward in the document.
  149.    *  this will also have the effect of collapsing the selection if the aExtend = PR_FALSE
  150.    *  the "point" of selection that is extended is considered the "focus" point. 
  151.    *  or the last point adjusted by the selection.
  152.    *  @param aForward forward or backward if PR_FALSE
  153.    *  @param aExtend  should it collapse the selection of extend it?
  154.    */
  155.     void characterMove(in boolean forward, in boolean extend);
  156.  
  157.    /** WordMove will move the selection one word forward/backward in the document.
  158.    *  this will also have the effect of collapsing the selection if the aExtend = PR_FALSE
  159.    *  the "point" of selection that is extended is considered the "focus" point. 
  160.    *  or the last point adjusted by the selection.
  161.    *  @param aForward forward or backward if PR_FALSE
  162.    *  @param aExtend  should it collapse the selection of extend it?
  163.    */
  164.  
  165.     void wordMove(in boolean forward, in boolean extend);
  166.  
  167.     /** LineMove will move the selection one line forward/backward in the document.
  168.    *  this will also have the effect of collapsing the selection if the aExtend = PR_FALSE
  169.    *  the "point" of selection that is extended is considered the "focus" point. 
  170.    *  or the last point adjusted by the selection.
  171.    *  @param aForward forward or backward if PR_FALSE
  172.    *  @param aExtend  should it collapse the selection of extend it?
  173.    */
  174.     void lineMove(in boolean forward, in boolean extend);
  175.  
  176.   /** IntraLineMove will move the selection to the front of the line or end of the line
  177.    *  in the document.
  178.    *  this will also have the effect of collapsing the selection if the aExtend = PR_FALSE
  179.    *  the "point" of selection that is extended is considered the "focus" point. 
  180.    *  or the last point adjusted by the selection.
  181.    *  @param aForward forward or backward if PR_FALSE
  182.    *  @param aExtend  should it collapse the selection of extend it?
  183.    */
  184.     void intraLineMove(in boolean forward, in boolean extend);
  185.  
  186.   /** PageMove will move the selection one page forward/backward in the document.
  187.    *  this will also have the effect of collapsing the selection if the aExtend = PR_FALSE
  188.    *  the "point" of selection that is extended is considered the "focus" point. 
  189.    *  or the last point adjusted by the selection.
  190.    *  @param aForward forward or backward if PR_FALSE
  191.    *  @param aExtend  should it collapse the selection of extend it?
  192.    */
  193.     void pageMove(in boolean forward, in boolean extend);
  194.  
  195.   /** CompleteScroll will move page view to the top or bottom of the document
  196.    *  @param aForward forward or backward if PR_FALSE
  197.    */
  198.     void completeScroll(in boolean forward);
  199.  
  200.   /** CompleteMove will move page view to the top or bottom of the document
  201.    *  this will also have the effect of collapsing the selection if the aExtend = PR_FALSE
  202.    *  the "point" of selection that is extended is considered the "focus" point. 
  203.    *  or the last point adjusted by the selection.
  204.    *  @param aForward forward or backward if PR_FALSE
  205.    *  @param aExtend  should it collapse the selection of extend it?
  206.    */
  207.     void completeMove(in boolean forward, in boolean extend);
  208.  
  209.  
  210.   /** ScrollPage will scroll the page without affecting the selection.
  211.    *  @param aForward scroll forward or backwards in selection
  212.    */
  213.     void scrollPage(in boolean forward);
  214.  
  215.   /** ScrolLine will scroll line up or down dependent on the boolean
  216.    *  @param aForward scroll forward or backwards in selection
  217.    */
  218.       void scrollLine(in boolean forward);
  219.  
  220.   /** ScrolHorizontal will scroll left or right dependent on the boolean
  221.    *  @param aLeft if true will scroll left. if not will scroll right.
  222.    */
  223.       void scrollHorizontal(in boolean left);
  224.   /** SelectAll will select the whole page
  225.    */
  226.     void selectAll();
  227.  
  228.   /** CheckVisibility will return true if textnode and offsets are actually rendered 
  229.    *  in the current precontext.
  230.    *  @param aNode textNode to test
  231.    *  @param aStartOffset  offset in dom to first char of textnode to test
  232.    *  @param aEndOffset    offset in dom to last char of textnode to test
  233.    *  @param aReturnBool   boolean returned TRUE if visible FALSE if not
  234.    */
  235.     boolean checkVisibility(in nsIDOMNode node, in short startOffset, in short endOffset);
  236.  
  237. };
  238. %{ C++
  239.    #define NS_ISELECTIONCONTROLLER_CID \
  240.    { 0xd2d1d179, 0x85a7, 0x11d3, \
  241.    { 0x99, 0x32, 0x0, 0x10, 0x83, 0x1, 0x23, 0x3c }}
  242. %}
  243.